package sk.naive.talker.props;

import java.util.*;

/**
 *
 * @author <a href="mailto:richter@bgs.sk">Richard Richter</a>
 * @version $Revision: 1.12 $ $Date: 2004/04/23 21:54:10 $
 */
public class BooleanProperty extends EnumeratedProperty {
	public static final String FALSE = Boolean.FALSE.toString();
	public static final String TRUE = Boolean.TRUE.toString();

	public Object defaultValue() {
		return FALSE;
	}

	public static boolean booleanValue(String s) {
		if (s == null) {
			return false;
		}
		return (s.equals(TRUE));
	}

	{
		Set s = new HashSet();
		s.add(TRUE);
		s.add(FALSE);
		validValues = Collections.unmodifiableSet(s);
	}
}
